<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/1/2
  Time: 17:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>login</title>
<%--    <link href="../css/login.css" type="text/css" rel="stylesheet">--%>
    <script type="text/javascript" src="script/jquery-1.7.2.js"></script>
    <link href="../css/login.css" type="text/css" rel="stylesheet">
    <script type="text/javascript">
        $(function () {
            $("#p2").blur(function () {
                var p1 = $("#p1").val();
                var p2 = $("#p2").val();
                if (p1 == p2) {
                    $("#td1").text("密码相同！")
                } else {
                    $("#td1").text("密码不同！")

                }
            })
            $("#bu1").click(function () {
                alert("dsadsa")
                window.location.replace("login.jsp?id=3");
            })
        })
    </script>
</head>
<body>
<div>
    <div>
        <table style="margin-left: 900px">
            <tr>
                <td>已有账号？<a href="login.jsp?id=1">登录</a></td>
            </tr>
            <tr>
                <td>没有账号？<a href="login.jsp?id=2">注册</a></td>
            </tr>
        </table>
        <%
            int id = Integer.parseInt(request.getParameter("id"));
            if (id == 1) {
        %>
        <form style="margin-top: -280px " method="post" action="event.jsp?login=0">
            <table style="margin-left: 750px">
                <tr>
                    <td>账号：</td>
                    <td><input class="sub inheight" type="text" name="acNum"></td>
                </tr>
                <tr>
                    <td>密码：</td>
                    <td><input class="sub inheight" type="password" name="password"></td>
                </tr>
                <tr>
                    <td><input class="sub" type="submit" value="提交" name="sub"></td>
                    <td>
<%--                        <button id="bu1" class="sub" name="forget">忘记密码</button>--%>
                        <input type="button" onclick="window.location.href='login.jsp?id=3'" class="sub" name="forget" value="忘记密码">
                    </td>
                </tr>
            </table>
        </form>
        <%
        } else if (id == 2) {
        %>
        <form style="margin-top: -280px " method="post" action="event.jsp?login=1">
            <table style="margin-left: 750px">
                <tr>
                    <td>账号：</td>
                    <td><input class="sub inheight" type="text" name="acNum"></td>
                </tr>
                <tr>
                    <td>密码：</td>
                    <td><input id="p1" class="sub inheight" type="password" name="password"></td>
                </tr>
                <tr>
                    <td>再次输入密码：</td>
                    <td><input id="p2" class="sub inheight" type="password" name="pw2"></td>
                    <td id="td1"></td>
                </tr>
                <tr>
                    <td>姓名：</td>
                    <td><input class="sub inheight" type="text" name="name"></td>
                </tr>
                <tr>
                    <td>年龄：</td>
                    <td><input class="sub inheight" type="text" name="age"></td>
                </tr>
                <tr>
                    <td>邮箱：</td>
                    <td><input class="sub inheight" type="text" name="email"></td>
                </tr>
                <tr>
                    <td>电话：</td>
                    <td><input class="sub inheight" type="text" name="phone"></td>
                </tr>
                <tr>
                    <td><input class="sub" type="submit" value="提交" name="sub"></td>
                    <td>
                        <input class="sub" type="reset" value="重置" name="res">
                    </td>
                </tr>
            </table>
        </form>
        <%
        } else if (id == 3) {
        %>
        <form style="margin-top: -280px " method="post" action="event.jsp?login=2">
            <table style="margin-left: 750px">
                <tr>
                    <td>输入邮箱：</td>
                    <td><input class="sub inheight" type="text" name="email"></td>
                </tr>
                <tr>
                    <td>输入更改的密码：</td>
                    <td><input class="sub inheight" type="password" name="password"></td>
                </tr>
                <tr>
                    <td><input class="sub" type="submit" value="更改密码" name="sub"></td>
                    <td>
                        <input class="sub" type="reset" value="重置" name="res">
                    </td>
                </tr>
            </table>
        </form>
        <%
            }
        %>
    </div>
</div>
</body>
</html>
